package org.example;

import org.example.dao.impl.StudentDaoimpl;
import org.example.pojo.Student;
import java.util.ArrayList;
import java.util.Date;

public class App {
    public static void main( String[] args ){
        Student student = new Student();
        student.setId(8);
        student.setStuName("张三");
        student.setStuGender("女");
        student.setStuUsername("zhangsan");
        student.setStuPassword("123456");
        student.setStuBrithday(new Date(System.currentTimeMillis()));
        StudentDaoimpl studentDao = new StudentDaoimpl();
        studentDao.Save(student);
        studentDao.DeleteById(2);
        ArrayList<Student> arrayList=studentDao.getAll();
        for (Student student1:arrayList){
            System.out.println(student1.toString());
        }
        System.out.println(studentDao.getStudentById(8).toString());
        System.out.println(studentDao.getStudentById(8).toString());
        studentDao.UpdateById(student);
        System.out.println(studentDao.getStudentById(8).toString());
    }
}
